//
//  NSError+category.m
//  hhr
//
//  Created by xtjun on 2019/3/21.
//  Copyright © 2019 qianhezi. All rights reserved.
//


#import "NSError+category.h"

@implementation NSError (category)

+ (instancetype)errorWithCode:(NSInteger)code errorReason:(NSString *)errorReason {
    if (!errorReason) return nil;
    NSDictionary *errorDict = @{NSLocalizedFailureReasonErrorKey:errorReason};
    return [NSError errorWithDomain:ERRPRDOMAIN code:code userInfo:errorDict];
}

@end
